﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace XGameFrame.Graphic
{
    public class StaticMouseSprite: StaticSpriteBase
    {
        #region Constructor
        public StaticMouseSprite(Texture2D pTexture,Vector2 pPosition)
            :base(pTexture,pPosition)
        {
            SetPosition();
            Bounds = new Rectangle((int)Position.X,
            (int)Position.Y,
            1,
            1);
            SourceRectangle = new Rectangle(
            0,
            0,
            Texture.Width,
            Texture.Height);
            DestRectangle = new Rectangle((int)Position.X, (int)Position.Y, Texture.Width, Texture.Height);
        }
        #endregion
        #region abstract Methods
        public override void Update(GameTime pGameTime)
        {
            SetPosition();
            Bounds = new Rectangle((int)Position.X,
            (int)Position.Y,
            1,
            1);
            SourceRectangle = new Rectangle(
            0,
            0,
            Texture.Width,
            Texture.Height);
            DestRectangle = new Rectangle((int)Position.X, (int)Position.Y, Texture.Width, Texture.Height);
        }
        public override void Draw(SpriteBatch pSpriteBatch)
        {
            pSpriteBatch.Draw(Texture, Position, SourceRectangle, Color.White, Rotation, Origin,Scale, SpriteEffect, LayerDepth);
        }

        public override void OnHover(PlayerIndex pPlayerIndex)
        {
        }

        public override void HandleInput(PlayerIndex pPlayerIndex)
        {
        }
        #endregion
        #region Methods
        public virtual void SetPosition()
        {
            Position = InputHandler.CurrentMousePosition;
        }
        #endregion
    }
}
